Skip to content

adicionando rotas v2 link de pagamento (criacao e edicao) e de assina…#12

Merged
jhernandes merged 4 commits intomasterfrom
feature/IPAG-6787-atualizandoRotasV2SubscriptionPaymentLink
Mar 12, 2026
Merged

adicionando rotas v2 link de pagamento (criacao e edicao) e de assina…#12
jhernandes merged 4 commits intomasterfrom
feature/IPAG-6787-atualizandoRotasV2SubscriptionPaymentLink

Conversation

@gabrielIpag
Copy link
Contributor

…tura (create e update)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds V2 routes for Payment Links (create and update) and Subscriptions (create and update) to the iPag SDK. It also adds an Owner relationship to the Customer model and adjusts dependency versions for PHP 7.4 compatibility.

Changes:

  • New model classes (SubscriptionV2, Plan, PlanTrial, PaymentLinkV2, CheckoutSettings) and their corresponding endpoint classes, registered in IpagClient.
  • Added Owner relationship to the Customer model with getter/setter and minor formatting changes.
  • Updated composer.json to pin PHP 7.4.33 platform and adjusted composer.lock dependencies accordingly (e.g., psr/log 1.1.4, doctrine/instantiator 1.5.0).

Reviewed changes

Copilot reviewed 21 out of 22 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Model/SubscriptionV2/SubscriptionV2.php New model for V2 subscriptions with schema, mutator, getters/setters
src/Model/SubscriptionV2/Plan.php New Plan sub-model for inline plan definitions in subscriptions
src/Model/SubscriptionV2/PlanTrial.php New PlanTrial sub-model for trial configuration
src/Model/PaymentLinkV2/PaymentLinkV2.php New model for V2 payment links with date format validation
src/Model/PaymentLinkV2/CheckoutSettings.php New CheckoutSettings sub-model for payment link checkout config
src/Model/Customer.php Added Owner relationship and minor formatting cleanup
src/Endpoint/SubscriptionV2Endpoint.php New endpoint with create/update methods for V2 subscriptions
src/Endpoint/PaymentLinksV2Endpoint.php New endpoint with create/update/get/list/listTransactions for V2 payment links
src/Core/IpagClient.php Registered new V2 endpoint accessors
tests/Model/SubscriptionV2Test.php Unit tests for SubscriptionV2 model
tests/Model/PaymentLinkV2Test.php Unit tests for PaymentLinkV2 model
tests/Endpoint/SubscriptionV2EndpointTest.php Endpoint integration tests for V2 subscriptions
tests/Endpoint/PaymentLinksV2EndpointTest.php Endpoint integration tests for V2 payment links
examples/subscription_v2/*.php Example usage scripts for V2 subscriptions
examples/payment_links_v2/*.php Example usage scripts for V2 payment links
composer.json Added PHP 7.4.33 platform constraint and audit ignore
composer.lock Updated dependency versions for PHP 7.4 compatibility

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 22 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +16 to +26
protected function schema(SchemaBuilder $schema): Schema
{
$schema->int('max_installments')->nullable();
$schema->float('min_installment_value')->nullable();
$schema->float('interest')->nullable();
$schema->int('interest_free_installments')->nullable();
$schema->int('fixed_installment')->nullable();
$schema->string('payment_method')->nullable();

return $schema->build();
}
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CheckoutSettings does not override jsonSerialize() to filter null values, unlike the other new model classes (SubscriptionV2, Plan, PlanTrial, PaymentLinkV2) which all include return array_filter(parent::jsonSerialize(), fn($v) => !is_null($v));. This inconsistency means null fields will be sent to the API when CheckoutSettings is serialized as part of a PaymentLinkV2 request. Consider adding the same jsonSerialize() override.

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jhernandes jhernandes self-assigned this Mar 12, 2026
@jhernandes jhernandes merged commit 15b9b3a into master Mar 12, 2026
2 checks passed
@jhernandes jhernandes deleted the feature/IPAG-6787-atualizandoRotasV2SubscriptionPaymentLink branch March 12, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants